<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/login', 'HomeController@showLogin');
Route::get('/', 'HomeController@showDashboard');

/* REST API routes */
Route::resource('usersAPI', 'UserAPIController');
Route::get('/usersAPI/matches/{id}', 'UserAPIController@getMatches');
Route::get('/usersAPI/groups/{id}', 'UserAPIController@getGroups');
/*Route::get('/users/getAPI/{id?}', 'UserController@getAPI');
Route::post('/users/saveAPI/', 'UserController@storeAPI');
Route::put('/users/updateAPI/', 'UserController@updateAPI');
Route::delete('/users/deleteAPI/{id}', 'UserController@destroyAPI');
*/

Route::resource('matchesAPI', 'MatchAPIController');
Route::get('/matchesAPI/getByToken/{id}', 'MatchAPIController@getByToken');
Route::get('/matchesAPI/getAdminUser/{id}', 'MatchAPIController@getAdminUser');
Route::get('/matchesAPI/getTeams/{id}', 'MatchAPIController@getTeams');
Route::get('/matchesAPI/getSubs/{id}', 'MatchAPIController@getSubs');
Route::get('/matchesAPI/getGuests/{id}', 'MatchAPIController@getGuests');
Route::post('/matchesAPI/updateSubs/', 'MatchAPIController@updateSubs');
Route::post('/matchesAPI/updateGuests/', 'MatchAPIController@updateGuests');
/*Route::get('/matches/getAPI/{id?}', 'MatchController@getAPI');
Route::post('/matches/saveAPI/', 'MatchController@storeAPI');
Route::put('/matches/updateAPI/', 'MatchController@updateAPI');
Route::delete('/matches/deleteAPI/{id}', 'MatchController@destroyAPI');*/

Route::resource('matchTypesAPI', 'MatchTypeAPIController');
/*Route::get('/matchTypes/getAPI/{id?}', 'MatchTypeController@getAPI');
Route::post('/matchTypes/saveAPI/', 'MatchTypeController@storeAPI');
Route::put('/matchTypes/updateAPI/', 'MatchTypeController@updateAPI');
Route::delete('/matchTypes/deleteAPI/{id}', 'MatchTypeController@destroyAPI');*/

Route::resource('fieldsAPI', 'FieldAPIController');
/*Route::get('/fields/getAPI/{id?}', 'FieldController@getAPI');
Route::post('/fields/saveAPI/', 'FieldController@storeAPI');
Route::put('/fields/updateAPI/', 'FieldController@updateAPI');
Route::delete('/fields/deleteAPI/{id}', 'FieldController@destroyAPI');*/

Route::resource('groupsAPI', 'GroupAPIController');
Route::get('/groupsAPI/getUsers/{id}', 'GroupAPIController@getUsers');
Route::post('/groupsAPI/updateUsers/', 'GroupAPIController@updateUsers');
/*Route::get('/groups/getAPI/{id?}', 'GroupController@getAPI');
Route::post('/groups/saveAPI/', 'GroupController@storeAPI');
Route::put('/groups/updateAPI/', 'GroupController@updateAPI');
Route::delete('/groups/deleteAPI/{id}', 'GroupController@destroyAPI');*/

Route::resource('teamsAPI', 'TeamAPIController');
Route::get('/teamsAPI/getUsers/{id}', 'TeamAPIController@getUsers');
Route::post('/teamsAPI/updateUsers/', 'TeamAPIController@updateUsers');
/*Route::get('/teams/getAPI/{id?}', 'TeamController@getAPI');
Route::post('/teams/saveAPI/', 'TeamController@storeAPI');
Route::put('/teams/updateAPI/', 'TeamController@updateAPI');
Route::delete('/teams/deleteAPI/{id}', 'TeamController@destroyAPI');*/
/* END REST API routes */

Route::post('/admins/login', 'AdminController@postLogin');
Route::get('/admins/logout', 'AdminController@getLogout');
Route::resource('admins', 'AdminController');
Route::resource('fields', 'FieldController');
Route::resource('groups', 'GroupController');
Route::resource('matches', 'MatchController');
Route::resource('matchTypes', 'MatchTypeController');
Route::resource('teams', 'TeamController');
Route::resource('users', 'UserController');

